home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.3 (Developer)…68k, x86, SPARC, PA-RISC] / NeXTSTEP 3.3 Dev Intel.iso / NextDeveloper / Headers / appkit / Scroller.h < prev    next >
Text File  |  1992-09-11  |  3KB  |  102 lines

  1. /*
  2.     Scroller.h
  3.     Application Kit, Release 2.0
  4.     Copyright (c) 1988, 1989, 1990, NeXT, Inc.  All rights reserved. 
  5. */
  6.  
  7. #import "Control.h"
  8.  
  9. /* Location of scroll arrows within the scroller */
  10.  
  11. #define    NX_SCROLLARROWSMAXEND    0
  12. #define    NX_SCROLLARROWSMINEND    1
  13. #define    NX_SCROLLARROWSNONE    2
  14.  
  15. /* Useable parts in the scroller */
  16.  
  17. #define    NX_SCROLLERNOPARTS    0
  18. #define    NX_SCROLLERONLYARROWS    1
  19. #define    NX_SCROLLERALLPARTS    2
  20.  
  21. /* Part codes for various parts of the scroller */
  22.  
  23. #define    NX_NOPART    0
  24. #define NX_DECPAGE    1
  25. #define    NX_KNOB        2
  26. #define    NX_INCPAGE    3
  27. #define NX_DECLINE    4
  28. #define NX_INCLINE    5
  29. #define    NX_KNOBSLOT    6
  30. #define    NX_JUMP        6
  31.  
  32. #define    NX_SCROLLERWIDTH    (18.0)
  33.  
  34. @interface Scroller : Control
  35. {
  36.     float               curValue;
  37.     float               perCent;
  38.     NXCoord             _knobSize;
  39.     int                 hitPart;
  40.     id                  target;
  41.     SEL                 action;
  42.     struct _sFlags {
  43. #ifdef __BIG_ENDIAN__
  44.     unsigned int        isHoriz:1;
  45.     unsigned int        arrowsLoc:2;
  46.     unsigned int        partsUsable:2;
  47.     unsigned int        _fine:1;
  48.     unsigned int        _RESERVED:6;
  49.     unsigned int        _needsEnableFlush:1;
  50.     unsigned int        _thumbing:1;
  51.     unsigned int        _slotDrawn:1;
  52.     unsigned int        _knobDrawn:1;
  53. #else
  54.     unsigned int        _knobDrawn:1;
  55.     unsigned int        _slotDrawn:1;
  56.     unsigned int        _thumbing:1;
  57.     unsigned int        _needsEnableFlush:1;
  58.     unsigned int        _RESERVED:6;
  59.     unsigned int        _fine:1;
  60.     unsigned int        partsUsable:2;
  61.     unsigned int        arrowsLoc:2;
  62.     unsigned int        isHoriz:1;
  63. #endif
  64.     }                   sFlags;
  65. }
  66.  
  67. - initFrame:(const NXRect *)frameRect;
  68. - drawParts;
  69. - awake;
  70. - (NXRect *)calcRect:(NXRect *)aRect forPart:(int)partCode;
  71. - checkSpaceForParts;
  72. - target;
  73. - setTarget:anObject;
  74. - (SEL)action;
  75. - setAction:(SEL)aSelector;
  76. - sizeTo:(NXCoord)width :(NXCoord)height;
  77. - setArrowsPosition:(int)where;
  78. - drawArrow:(BOOL)whichButton :(BOOL)flag;
  79. - drawKnob;
  80. - drawSelf:(const NXRect *)rects :(int)rectCount;
  81. - highlight:(BOOL)flag;
  82. - (int)testPart:(const NXPoint *)thePoint;
  83. - trackKnob:(NXEvent *)theEvent;
  84. - trackScrollButtons:(NXEvent *)theEvent;
  85. - mouseDown:(NXEvent *)theEvent;
  86. - (int)hitPart;
  87. - (float)floatValue;
  88. - setFloatValue:(float)aFloat :(float)percent;
  89. - setFloatValue:(float)aFloat;
  90. - (BOOL)acceptsFirstMouse;
  91. - write:(NXTypedStream *)stream;
  92. - read:(NXTypedStream *)stream;
  93.  
  94. /* 
  95.  * The following new... methods are now obsolete.  They remain in this  
  96.  * interface file for backward compatibility only.  Use Object's alloc method  
  97.  * and the init... methods defined in this class instead.
  98.  */
  99. + newFrame:(const NXRect *)frameRect;
  100.  
  101. @end
  102.